package com.example.greetingcard

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Email
import androidx.compose.material.icons.rounded.Phone
import androidx.compose.material.icons.rounded.Share
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

class BusinessCardActivity {

    @Preview(showBackground = true)
    @Composable
    fun BusinessCard(modifier: Modifier = Modifier) {
        Column(
            verticalArrangement = Arrangement.Center,
            horizontalAlignment = Alignment.CenterHorizontally,
            modifier = Modifier
                .fillMaxSize()
                .background(color = Color.LightGray)
                .padding(8.dp)
        ) {
            Column(
                verticalArrangement = Arrangement.Center,
                horizontalAlignment = Alignment.CenterHorizontally
            ) {
                val image = painterResource(id = R.drawable.android_logo)
                Image(
                    painter = image,
                    contentDescription = null,
                    modifier = Modifier
                        .background(color = Color.Blue)
                        .size(152.dp)
                )

                Text(
                    text = "Forrest Gump",
                    fontSize = 36.sp,
                    fontFamily = FontFamily.SansSerif
                )

                Text(
                    text = "Student、Solider、Captain",
                    fontSize = 18.sp,
                    fontFamily = FontFamily.Monospace,
                    color = Color.Blue
                )
            }

            Spacer(modifier = Modifier.size(252.dp))

            Column(
                verticalArrangement = Arrangement.Center,

            ) {
                Row(modifier = Modifier.padding(4.dp)) {
                    Icon(
                        imageVector = Icons.Rounded.Phone,
                        contentDescription = null,
                        tint = Color.Yellow,
                    )
                    Spacer(modifier = modifier.size(8.dp))
                    Text(
                        text = "+86(755) 265 5739",
                        fontSize = 18.sp,
                        fontFamily = FontFamily.Monospace
                    )
                }
                Row(modifier = Modifier.padding(4.dp)) {
                    Icon(imageVector = Icons.Rounded.Share,
                        contentDescription = null,
                        tint = Color.Yellow
                    )
                    Spacer(modifier = modifier.size(8.dp))
                    Text(
                        text = "@AndroidDev",
                        fontSize = 18.sp,
                        fontFamily = FontFamily.Monospace
                    )
                }
                Row(modifier = Modifier.padding(4.dp)) {
                    Icon(imageVector = Icons.Rounded.Email,
                        contentDescription = null,
                        tint = Color.Yellow
                    )
                    Spacer(modifier = modifier.size(8.dp))
                    Text(
                        text = "forrest.gump@android.com",
                        fontSize = 18.sp,
                        fontFamily = FontFamily.SansSerif
                    )
                }
            }
        }
    }
}